#ifndef _SIANOSPI_H_
#define _SIANOSPI_H_


#include <windows.h>
#include <pm.h>

#include "BusDrvIf.h"
//#include "SianoDMA_API.h"
#include "smsspicommon.h"

#include "dbg_prn.h"

/************************************************************************/


/////////////////////////////////////////////////
//for posting RETAILMSG for debug - remove remark
//#define POSTDEBUGMSG
/////////////////////////////////////////////////

typedef enum _CLIENTTYPE {ClientTypeNone,ClientTypeControl,ClientTypeData,ClientTypeIpData}CLIENTTYPE;


#define RX_PACKET_SIZE	0x1000
#define NUM_OF_RX_PACKES	100//48//24//4
#define SMM100_HDR_SIZE	8
#define SPI_PREAMBLE 0x7EE75AA5//0xA55AE77E//0xA5, 0x5A, 0xE7, 0x7E,//Preamble in little endian
#define SPI_PREAMBLE_REVERSE 0xA55AE77E
#define SPI_PREAMBLE_SIZE 4

typedef enum
{
	SPI_DEVICE_STELLAR = 0,
	SPI_DEVICE_NOVA,
	SPI_DEVICE_VEGA,
	SPI_DEVICE_NONE = 0xFFFFFFFF

} SPI_DEVICE_TYPE_E;
#ifdef _SIANO_DMA
typedef struct DEVICE_DMA_SERVICE_S
{
	HMODULE				hdl;
	LPVOID				rxDmaDevice;
	LPVOID				txDmaDevice;
	DMA_SetUpChannelF	dmaSetUpChannel;
	DMA_ConfigChannelF	dmaConfigChannel;
	DMA_RemoveChannelF	dmaRemoveChannel;
}DEVICE_DMA_SERVICE_ST;
#endif
#define MAX_REG_PATH_SIZE 100
										//adapter//Buff//Len



typedef struct _SPIDEVICEEXTENSION
{

	struct spi_dev		dev;
	void (*Callback)(PCHAR buf, int len) ;
	BOOL 				PaddingAllowed;
	rx_buffer_st		rxbuf;
	char 				*txbuf;
	unsigned long		txbuf_phy_addr;
	HANDLE				WriteOperation;
	HANDLE				transferMsgQueue;
	HANDLE				transferThread;
	HANDLE				performanceThread;
	PVOID				phyDrv;
	HANDLE				hSmsGenDrv;				//GenDriver handle.
	BD_ReadCBFunc		pBD_ReadCBFunc;
	BD_TYPE_E			bdType;
	CEDEVICE_POWER_STATE	powerState;
	DWORD					hBDContext;
}SPIDEVICEEXTENSION, *PSPIDEVICEEXTENSION;


DWORD WINAPI SPI_Write(DWORD  dwContext, LPVOID pBuff, DWORD  BufferLength) ;


#endif